
<!DOCTYPE HTML>
<html lang="en" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>入门指南 · InfluxDB中文文档</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        <meta name="author" content="jasper">
        
        
    
    <link rel="stylesheet" href="../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-comment/plugin.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="../Guide/" />
    
    
    <link rel="prev" href="installation.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    
    
        
        <li>
            <a href="https://legacy.gitbook.com/book/jasper-zhang1/influxdb" target="_blank" class="custom-link">InfluxDB中文文档</a>
        </li>
    
    

    
    <li class="divider"></li>
    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../">
            
                <a href="../">
            
                    
                    前言
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="./">
            
                <a href="./">
            
                    
                    介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="installation.html">
            
                <a href="installation.html">
            
                    
                    安装
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.2.2" data-path="getting_start.html">
            
                <a href="getting_start.html">
            
                    
                    入门指南
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../Guide/">
            
                <a href="../Guide/">
            
                    
                    使用指南
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../Guide/writing_data.html">
            
                <a href="../Guide/writing_data.html">
            
                    
                    写入数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../Guide/querying_data.html">
            
                <a href="../Guide/querying_data.html">
            
                    
                    查询数据
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../Guide/downsampling_and_retention.html">
            
                <a href="../Guide/downsampling_and_retention.html">
            
                    
                    采样和数据保留
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.4" data-path="../Guide/hardware_sizing.html">
            
                <a href="../Guide/hardware_sizing.html">
            
                    
                    硬件指南
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.5" data-path="../Guide/https_setup.html">
            
                <a href="../Guide/https_setup.html">
            
                    
                    HTTPS设置
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="../Concepts/">
            
                <a href="../Concepts/">
            
                    
                    概念介绍
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="../Concepts/key_concepts.html">
            
                <a href="../Concepts/key_concepts.html">
            
                    
                    关键概念
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="../Concepts/glossary.html">
            
                <a href="../Concepts/glossary.html">
            
                    
                    专业术语
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.3" data-path="../Concepts/crosswalk.html">
            
                <a href="../Concepts/crosswalk.html">
            
                    
                    与SQL比较
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="../Concepts/insights_tradeoffs.html">
            
                <a href="../Concepts/insights_tradeoffs.html">
            
                    
                    InfluxDB的设计见解和权衡
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.5" data-path="../Concepts/schema_and_data_layout.html">
            
                <a href="../Concepts/schema_and_data_layout.html">
            
                    
                    schema设计
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.6" data-path="../Concepts/storage_engine.html">
            
                <a href="../Concepts/storage_engine.html">
            
                    
                    存储引擎
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../Write_protocols/">
            
                <a href="../Write_protocols/">
            
                    
                    写入协议
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../Write_protocols/line_protocol.html">
            
                <a href="../Write_protocols/line_protocol.html">
            
                    
                    行协议
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.6" data-path="../Query_language/">
            
                <a href="../Query_language/">
            
                    
                    查询语言
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.6.1" data-path="../Query_language/data_exploration.html">
            
                <a href="../Query_language/data_exploration.html">
            
                    
                    数据查询语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.2" data-path="../Query_language/schema_exploration.html">
            
                <a href="../Query_language/schema_exploration.html">
            
                    
                    schema查询语法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.3" data-path="../Query_language/database_management.html">
            
                <a href="../Query_language/database_management.html">
            
                    
                    数据库管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.4" data-path="../Query_language/continuous_queries.html">
            
                <a href="../Query_language/continuous_queries.html">
            
                    
                    连续查询
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.5" data-path="../Query_language/functions.html">
            
                <a href="../Query_language/functions.html">
            
                    
                    函数
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.6" data-path="../Query_language/math_operators.html">
            
                <a href="../Query_language/math_operators.html">
            
                    
                    数学运算符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.6.7" data-path="../Query_language/authentication_and_authorization.html">
            
                <a href="../Query_language/authentication_and_authorization.html">
            
                    
                    认证和授权
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.7" data-path="../Troubleshooting/">
            
                <a href="../Troubleshooting/">
            
                    
                    故障排除
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.7.1" data-path="../Troubleshooting/faq.html">
            
                <a href="../Troubleshooting/faq.html">
            
                    
                    FAQ
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.2" data-path="../Troubleshooting/system_monitor.html">
            
                <a href="../Troubleshooting/system_monitor.html">
            
                    
                    系统监控
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.3" data-path="../Troubleshooting/query_management.html">
            
                <a href="../Troubleshooting/query_management.html">
            
                    
                    查询管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.7.4" data-path="../Troubleshooting/error_messages.html">
            
                <a href="../Troubleshooting/error_messages.html">
            
                    
                    错误信息
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href=".." >入门指南</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x5165;&#x95E8;&#x6307;&#x5357;">&#x5165;&#x95E8;&#x6307;&#x5357;</h1>
<p>InfluxDB&#x5B89;&#x88C5;&#x5B8C;&#x6210;&#x4E4B;&#x540E;&#xFF0C;&#x6211;&#x4EEC;&#x5F00;&#x59CB;&#x6765;&#x505A;&#x4E00;&#x4E9B;&#x6709;&#x610F;&#x601D;&#x7684;&#x4E8B;&#x3002;&#x5728;&#x8FD9;&#x4E00;&#x7AE0;&#x91CC;&#x9762;&#x6211;&#x4EEC;&#x5C06;&#x4F1A;&#x7528;&#x5230;<code>influx</code>&#x8FD9;&#x4E2A;&#x547D;&#x4EE4;&#x884C;&#x5DE5;&#x5177;&#xFF0C;&#x8FD9;&#x4E2A;&#x5DE5;&#x5177;&#x5305;&#x542B;&#x5728;InfluxDB&#x7684;&#x5B89;&#x88C5;&#x5305;&#x91CC;&#xFF0C;&#x662F;&#x4E00;&#x4E2A;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#x5E93;&#x7684;&#x8F7B;&#x91CF;&#x7EA7;&#x5DE5;&#x5177;&#x3002;&#x5B83;&#x76F4;&#x63A5;&#x901A;&#x8FC7;InfluxDB&#x7684;HTTP&#x63A5;&#x53E3;(&#x5982;&#x679C;&#x6CA1;&#x6709;&#x4FEE;&#x6539;&#xFF0C;&#x9ED8;&#x8BA4;&#x662F;8086)&#x6765;&#x548C;InfluxDB&#x901A;&#x4FE1;&#x3002;</p>
<blockquote>
<p>&#x8BF4;&#x660E;&#xFF1A;&#x4E5F;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x53D1;&#x9001;&#x88F8;&#x7684;HTTP&#x8BF7;&#x6C42;&#x6765;&#x64CD;&#x4F5C;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x4F8B;&#x5982;<code>curl</code></p>
</blockquote>
<h2 id="&#x521B;&#x5EFA;&#x6570;&#x636E;&#x5E93;">&#x521B;&#x5EFA;&#x6570;&#x636E;&#x5E93;</h2>
<p>&#x5982;&#x679C;&#x4F60;&#x5DF2;&#x7ECF;&#x5728;&#x672C;&#x5730;&#x5B89;&#x88C5;&#x8FD0;&#x884C;&#x4E86;InfluxDB&#xFF0C;&#x4F60;&#x5C31;&#x53EF;&#x4EE5;&#x76F4;&#x63A5;&#x4F7F;&#x7528;<code>influx</code>&#x547D;&#x4EE4;&#x884C;&#xFF0C;&#x6267;&#x884C;<code>influx</code>&#x8FDE;&#x63A5;&#x5230;&#x672C;&#x5730;&#x7684;InfluxDB&#x5B9E;&#x4F8B;&#x4E0A;&#x3002;&#x8F93;&#x51FA;&#x5C31;&#x50CF;&#x4E0B;&#x9762;&#x8FD9;&#x6837;&#xFF1A;</p>
<pre><code>$ influx -precision rfc3339
Connected to http://localhost:8086 version 1.2.x
InfluxDB shell 1.2.x
&gt;
</code></pre><blockquote>
<p>&#x8BF4;&#x660E;:  </p>
<ul>
<li>InfluxDB&#x7684;HTTP&#x63A5;&#x53E3;&#x9ED8;&#x8BA4;&#x8D77;&#x5728;<code>8086</code>&#x4E0A;&#xFF0C;&#x6240;&#x4EE5;<code>influx</code>&#x9ED8;&#x8BA4;&#x4E5F;&#x662F;&#x8FDE;&#x7684;&#x672C;&#x5730;&#x7684;<code>8086</code>&#x7AEF;&#x53E3;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x901A;&#x8FC7;<code>influx --help</code>&#x6765;&#x770B;&#x600E;&#x4E48;&#x4FEE;&#x6539;&#x9ED8;&#x8BA4;&#x503C;&#x3002;</li>
<li><code>-precision</code>&#x53C2;&#x6570;&#x8868;&#x660E;&#x4E86;&#x4EFB;&#x4F55;&#x8FD4;&#x56DE;&#x7684;&#x65F6;&#x95F4;&#x6233;&#x7684;&#x683C;&#x5F0F;&#x548C;&#x7CBE;&#x5EA6;&#xFF0C;&#x5728;&#x4E0A;&#x9762;&#x7684;&#x4F8B;&#x5B50;&#x91CC;&#xFF0C;<code>rfc3339</code>&#x662F;&#x8BA9;InfluxDB&#x8FD4;&#x56DE;<a href="https://www.ietf.org/rfc/rfc3339.txt" target="_blank">RFC339</a>&#x683C;&#x5F0F;(YYYY-MM-DDTHH:MM:SS.nnnnnnnnnZ)&#x7684;&#x65F6;&#x95F4;&#x6233;&#x3002;</li>
</ul>
</blockquote>
<p>&#x8FD9;&#x6837;&#x8FD9;&#x4E2A;&#x547D;&#x4EE4;&#x884C;&#x5DF2;&#x7ECF;&#x51C6;&#x5907;&#x597D;&#x63A5;&#x6536;influx&#x7684;&#x67E5;&#x8BE2;&#x8BED;&#x53E5;&#x4E86;(&#x7B80;&#x79F0;InfluxQL)&#xFF0C;&#x7528;<code>exit</code>&#x53EF;&#x4EE5;&#x9000;&#x51FA;&#x547D;&#x4EE4;&#x884C;&#x3002;</p>
<p>&#x7B2C;&#x4E00;&#x6B21;&#x5B89;&#x88C5;&#x597D;InfluxDB&#x4E4B;&#x540E;&#x662F;&#x6CA1;&#x6709;&#x6570;&#x636E;&#x5E93;&#x7684;(&#x9664;&#x4E86;&#x7CFB;&#x7EDF;&#x81EA;&#x5E26;&#x7684;<code>_internal</code>)&#xFF0C;&#x56E0;&#x6B64;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x662F;&#x6211;&#x4EEC;&#x9996;&#x5148;&#x8981;&#x505A;&#x7684;&#x4E8B;&#xFF0C;&#x901A;&#x8FC7;<code>CREATE DATABASE &lt;db-name&gt;</code>&#x8FD9;&#x6837;&#x7684;InfluxQL&#x8BED;&#x53E5;&#x6765;&#x521B;&#x5EFA;&#xFF0C;&#x5176;&#x4E2D;<code>&lt;db-name&gt;</code>&#x5C31;&#x662F;&#x6570;&#x636E;&#x5E93;&#x7684;&#x540D;&#x5B57;&#x3002;&#x6570;&#x636E;&#x5E93;&#x7684;&#x540D;&#x5B57;&#x53EF;&#x4EE5;&#x662F;&#x88AB;&#x53CC;&#x5F15;&#x53F7;&#x5F15;&#x8D77;&#x6765;&#x7684;&#x4EFB;&#x610F;Unicode&#x5B57;&#x7B26;&#x3002; &#x5982;&#x679C;&#x540D;&#x79F0;&#x53EA;&#x5305;&#x542B;ASCII&#x5B57;&#x6BCD;&#xFF0C;&#x6570;&#x5B57;&#x6216;&#x4E0B;&#x5212;&#x7EBF;&#xFF0C;&#x5E76;&#x4E14;&#x4E0D;&#x4EE5;&#x6570;&#x5B57;&#x5F00;&#x5934;&#xFF0C;&#x90A3;&#x4E48;&#x4E5F;&#x53EF;&#x4EE5;&#x4E0D;&#x7528;&#x5F15;&#x8D77;&#x6765;&#x3002;</p>
<p>&#x6211;&#x4EEC;&#x6765;&#x521B;&#x5EFA;&#x4E00;&#x4E2A;<code>mydb</code>&#x6570;&#x636E;&#x5E93;&#xFF1A;</p>
<pre><code>&gt; CREATE DATABASE mydb
&gt;
</code></pre><blockquote>
<p>&#x8BF4;&#x660E;&#xFF1A;&#x5728;&#x8F93;&#x5165;&#x4E0A;&#x9762;&#x7684;&#x8BED;&#x53E5;&#x4E4B;&#x540E;&#xFF0C;&#x5E76;&#x6CA1;&#x6709;&#x770B;&#x5230;&#x4EFB;&#x4F55;&#x4FE1;&#x606F;&#xFF0C;&#x8FD9;&#x5728;CLI&#x91CC;&#xFF0C;&#x8868;&#x793A;&#x8BED;&#x53E5;&#x88AB;&#x6267;&#x884C;&#x5E76;&#x4E14;&#x6CA1;&#x6709;&#x9519;&#x8BEF;&#xFF0C;&#x5982;&#x679C;&#x6709;&#x9519;&#x8BEF;&#x4FE1;&#x606F;&#x5C55;&#x793A;&#xFF0C;&#x90A3;&#x4E00;&#x5B9A;&#x662F;&#x54EA;&#x91CC;&#x51FA;&#x95EE;&#x9898;&#x4E86;&#xFF0C;&#x8FD9;&#x5C31;&#x662F;&#x6240;&#x8C13;&#x7684;<code>&#x6CA1;&#x6709;&#x6D88;&#x606F;&#x5C31;&#x662F;&#x597D;&#x6D88;&#x606F;</code>&#x3002;</p>
</blockquote>
<p>&#x73B0;&#x5728;&#x6570;&#x636E;&#x5E93;<code>mydb</code>&#x5DF2;&#x7ECF;&#x521B;&#x5EFA;&#x597D;&#x4E86;&#xFF0C;&#x6211;&#x4EEC;&#x53EF;&#x4EE5;&#x7528;<code>SHOW DATABASES</code>&#x8BED;&#x53E5;&#x6765;&#x770B;&#x770B;&#x5DF2;&#x5B58;&#x5728;&#x7684;&#x6570;&#x636E;&#x5E93;&#xFF1A;</p>
<pre><code>&gt; SHOW DATABASES
name: databases
---------------
name
_internal
mydb

&gt;
</code></pre><blockquote>
<p>&#x8BF4;&#x660E;&#xFF1A;<code>_internal</code>&#x6570;&#x636E;&#x5E93;&#x662F;&#x7528;&#x6765;&#x5B58;&#x50A8;InfluxDB&#x5185;&#x90E8;&#x7684;&#x5B9E;&#x65F6;&#x76D1;&#x63A7;&#x6570;&#x636E;&#x7684;&#x3002;</p>
</blockquote>
<p>&#x4E0D;&#x50CF;<code>SHOW DATABASES</code>&#xFF0C;&#x5927;&#x90E8;&#x5206;InfluxQL&#x9700;&#x8981;&#x4F5C;&#x7528;&#x5728;&#x4E00;&#x4E2A;&#x7279;&#x5B9A;&#x7684;&#x6570;&#x636E;&#x5E93;&#x4E0A;&#x3002;&#x4F60;&#x5F53;&#x7136;&#x53EF;&#x4EE5;&#x5728;&#x6BCF;&#x4E00;&#x4E2A;&#x67E5;&#x8BE2;&#x8BED;&#x53E5;&#x4E0A;&#x5E26;&#x4E0A;&#x4F60;&#x60F3;&#x67E5;&#x7684;&#x6570;&#x636E;&#x5E93;&#x7684;&#x540D;&#x5B57;&#xFF0C;&#x4F46;&#x662F;CLI&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A;&#x66F4;&#x4E3A;&#x65B9;&#x4FBF;&#x7684;&#x65B9;&#x5F0F;<code>USE &lt;db-name&gt;</code>&#xFF0C;&#x8FD9;&#x4F1A;&#x4E3A;&#x4F60;&#x540E;&#x9762;&#x7684;&#x6240;&#x4EE5;&#x7684;&#x8BF7;&#x6C42;&#x8BBE;&#x7F6E;&#x5230;&#x8FD9;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x4E0A;&#x3002;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>&gt; USE mydb
Using database mydb
&gt;
</code></pre><p>&#x4EE5;&#x4E0B;&#x7684;&#x64CD;&#x4F5C;&#x90FD;&#x4F5C;&#x7528;&#x4E8E;<code>mydb</code>&#x8FD9;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#x4E4B;&#x4E0A;&#x3002;</p>
<h2 id="&#x8BFB;&#x5199;&#x6570;&#x636E;">&#x8BFB;&#x5199;&#x6570;&#x636E;</h2>
<p>&#x73B0;&#x5728;&#x6211;&#x4EEC;&#x5DF2;&#x7ECF;&#x6709;&#x4E86;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x5E93;&#xFF0C;&#x90A3;&#x4E48;InfluxDB&#x5C31;&#x53EF;&#x4EE5;&#x5F00;&#x59CB;&#x63A5;&#x6536;&#x8BFB;&#x5199;&#x4E86;&#x3002;</p>
<p>&#x9996;&#x5148;&#x5BF9;&#x6570;&#x636E;&#x5B58;&#x50A8;&#x7684;&#x683C;&#x5F0F;&#x6765;&#x4E2A;&#x5165;&#x95E8;&#x4ECB;&#x7ECD;&#x3002;InfluxDB&#x91CC;&#x5B58;&#x50A8;&#x7684;&#x6570;&#x636E;&#x88AB;&#x79F0;&#x4E3A;<code>&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;</code>&#xFF0C;&#x5176;&#x5305;&#x542B;&#x4E00;&#x4E2A;&#x6570;&#x503C;&#xFF0C;&#x5C31;&#x50CF;CPU&#x7684;load&#x503C;&#x6216;&#x662F;&#x6E29;&#x5EA6;&#x503C;&#x7C7B;&#x4F3C;&#x7684;&#x3002;&#x65F6;&#x5E8F;&#x6570;&#x636E;&#x6709;&#x96F6;&#x4E2A;&#x6216;&#x591A;&#x4E2A;&#x6570;&#x636E;&#x70B9;&#xFF0C;&#x6BCF;&#x4E00;&#x4E2A;&#x90FD;&#x662F;&#x4E00;&#x4E2A;&#x6307;&#x6807;&#x503C;&#x3002;&#x6570;&#x636E;&#x70B9;&#x5305;&#x62EC;<code>time</code>(&#x4E00;&#x4E2A;&#x65F6;&#x95F4;&#x6233;)&#xFF0C;<code>measurement</code>(&#x4F8B;&#x5982;cpu_load)&#xFF0C;&#x81F3;&#x5C11;&#x4E00;&#x4E2A;k-v&#x683C;&#x5F0F;&#x7684;<code>field</code>(&#x4E5F;&#x5373;&#x6307;&#x6807;&#x7684;&#x6570;&#x503C;&#x4F8B;&#x5982; &#x201C;value=0.64&#x201D;&#x6216;&#x8005;&#x201C;temperature=21.2&#x201D;)&#xFF0C;&#x96F6;&#x4E2A;&#x6216;&#x591A;&#x4E2A;<code>tag</code>&#xFF0C;&#x5176;&#x4E00;&#x822C;&#x662F;&#x5BF9;&#x4E8E;&#x8FD9;&#x4E2A;&#x6307;&#x6807;&#x503C;&#x7684;&#x5143;&#x6570;&#x636E;(&#x4F8B;&#x5982;&#x201C;host=server01&#x201D;, &#x201C;region=EMEA&#x201D;, &#x201C;dc=Frankfurt)&#x3002;</p>
<p>&#x5728;&#x6982;&#x5FF5;&#x4E0A;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x5C06;<code>measurement</code>&#x7C7B;&#x6BD4;&#x4E8E;SQL&#x91CC;&#x9762;&#x7684;table&#xFF0C;&#x5176;&#x4E3B;&#x952E;&#x7D22;&#x5F15;&#x603B;&#x662F;&#x65F6;&#x95F4;&#x6233;&#x3002;<code>tag</code>&#x548C;<code>field</code>&#x662F;&#x5728;table&#x91CC;&#x7684;&#x5176;&#x4ED6;&#x5217;&#xFF0C;<code>tag</code>&#x662F;&#x88AB;&#x7D22;&#x5F15;&#x8D77;&#x6765;&#x7684;&#xFF0C;<code>field</code>&#x6CA1;&#x6709;&#x3002;&#x4E0D;&#x540C;&#x4E4B;&#x5904;&#x5728;&#x4E8E;&#xFF0C;&#x5728;InfluxDB&#x91CC;&#xFF0C;&#x4F60;&#x53EF;&#x4EE5;&#x6709;&#x51E0;&#x767E;&#x4E07;&#x7684;measurements&#xFF0C;&#x4F60;&#x4E0D;&#x7528;&#x4E8B;&#x5148;&#x5B9A;&#x4E49;&#x6570;&#x636E;&#x7684;scheme&#xFF0C;&#x5E76;&#x4E14;null&#x503C;&#x4E0D;&#x4F1A;&#x88AB;&#x5B58;&#x50A8;&#x3002;</p>
<p>&#x5C06;&#x6570;&#x636E;&#x70B9;&#x5199;&#x5165;InfluxDB&#xFF0C;&#x53EA;&#x9700;&#x8981;&#x9075;&#x5B88;&#x5982;&#x4E0B;&#x7684;&#x884C;&#x534F;&#x8BAE;&#xFF1A;</p>
<pre><code>&lt;measurement&gt;[,&lt;tag-key&gt;=&lt;tag-value&gt;...] &lt;field-key&gt;=&lt;field-value&gt;[,&lt;field2-key&gt;=&lt;field2-value&gt;...] [unix-nano-timestamp]
</code></pre><p>&#x4E0B;&#x9762;&#x662F;&#x6570;&#x636E;&#x5199;&#x5165;InfluxDB&#x7684;&#x683C;&#x5F0F;&#x793A;&#x4F8B;&#xFF1A;</p>
<pre><code>cpu,host=serverA,region=us_west value=0.64
payment,device=mobile,product=Notepad,method=credit billed=33,licenses=3i 1434067467100293230
stock,symbol=AAPL bid=127.46,ask=127.48
temperature,machine=unit42,type=assembly external=25,internal=37 1434067467000000000
</code></pre><blockquote>
<p>&#x8BF4;&#x660E;&#xFF1A;&#x5173;&#x4E8E;&#x5199;&#x5165;&#x683C;&#x5F0F;&#x7684;&#x66F4;&#x591A;&#x8BED;&#x6CD5;&#xFF0C;&#x8BF7;&#x53C2;&#x8003;<a href="">&#x5199;&#x5165;&#x8BED;&#x6CD5;</a>&#x8FD9;&#x4E00;&#x7AE0;&#x3002;</p>
</blockquote>
<p>&#x4F7F;&#x7528;CLI&#x63D2;&#x5165;&#x5355;&#x6761;&#x7684;&#x65F6;&#x95F4;&#x5E8F;&#x5217;&#x6570;&#x636E;&#x5230;InfluxDB&#x4E2D;&#xFF0C;&#x7528;<code>INSERT</code>&#x540E;&#x8DDF;&#x6570;&#x636E;&#x70B9;&#xFF1A;</p>
<pre><code>&gt; INSERT cpu,host=serverA,region=us_west value=0.64
&gt;
</code></pre><p>&#x8FD9;&#x6837;&#x4E00;&#x4E2A;measurement&#x4E3A;<code>cpu</code>&#xFF0C;tag&#x662F;<code>host</code>&#x548C;<code>region</code>&#xFF0C;<code>value</code>&#x503C;&#x4E3A;<code>0.64</code>&#x7684;&#x6570;&#x636E;&#x70B9;&#x88AB;&#x5199;&#x5165;&#x4E86;InfluxDB&#x4E2D;&#x3002;</p>
<p>&#x73B0;&#x5728;&#x6211;&#x4EEC;&#x67E5;&#x51FA;&#x5199;&#x5165;&#x7684;&#x8FD9;&#x7B14;&#x6570;&#x636E;&#xFF1A;</p>
<pre><code>&gt; SELECT &quot;host&quot;, &quot;region&quot;, &quot;value&quot; FROM &quot;cpu&quot;
name: cpu
---------
time                                     host         region   value
2015-10-21T19:28:07.580664347Z  serverA      us_west     0.64

&gt;
</code></pre><blockquote>
<p>&#x8BF4;&#x660E;&#xFF1A;&#x6211;&#x4EEC;&#x5728;&#x5199;&#x5165;&#x7684;&#x65F6;&#x5019;&#x6CA1;&#x6709;&#x5305;&#x542B;&#x65F6;&#x95F4;&#x6233;&#xFF0C;&#x5F53;&#x6CA1;&#x6709;&#x5E26;&#x65F6;&#x95F4;&#x6233;&#x7684;&#x65F6;&#x5019;&#xFF0C;InfluxDB&#x4F1A;&#x81EA;&#x52A8;&#x6DFB;&#x52A0;&#x672C;&#x5730;&#x7684;&#x5F53;&#x524D;&#x65F6;&#x95F4;&#x4F5C;&#x4E3A;&#x5B83;&#x7684;&#x65F6;&#x95F4;&#x6233;&#x3002;</p>
</blockquote>
<p>&#x8BA9;&#x6211;&#x4EEC;&#x6765;&#x5199;&#x5165;&#x53E6;&#x4E00;&#x7B14;&#x6570;&#x636E;&#xFF0C;&#x5B83;&#x5305;&#x542B;&#x6709;&#x4E24;&#x4E2A;&#x5B57;&#x6BB5;&#xFF1A;</p>
<pre><code>&gt; INSERT temperature,machine=unit42,type=assembly external=25,internal=37
&gt;
</code></pre><p>&#x67E5;&#x8BE2;&#x7684;&#x65F6;&#x5019;&#x60F3;&#x8981;&#x8FD4;&#x56DE;&#x6240;&#x6709;&#x7684;&#x5B57;&#x6BB5;&#x548C;tag&#xFF0C;&#x53EF;&#x4EE5;&#x7528;<code>*</code>&#xFF1A;</p>
<pre><code>
&gt; SELECT * FROM &quot;temperature&quot;
name: temperature
-----------------
time                                     external      internal     machine    type
2015-10-21T19:28:08.385013942Z  25                37             unit42  assembly

&gt;
</code></pre><p>InfluxQL&#x8FD8;&#x6709;&#x5F88;&#x591A;&#x7279;&#x6027;&#x548C;&#x7528;&#x6CD5;&#x6CA1;&#x6709;&#x88AB;&#x63D0;&#x53CA;&#xFF0C;&#x5305;&#x62EC;&#x652F;&#x6301;golang&#x6837;&#x5F0F;&#x7684;&#x6B63;&#x5219;&#xFF0C;&#x4F8B;&#x5982;&#xFF1A;</p>
<pre><code>&gt; SELECT * FROM /.*/ LIMIT 1
--
&gt; SELECT * FROM &quot;cpu_load_short&quot;
--
&gt; SELECT * FROM &quot;cpu_load_short&quot; WHERE &quot;value&quot; &gt; 0.9
</code></pre><p>&#x8FD9;&#x5C31;&#x662F;&#x4F60;&#x9700;&#x8981;&#x77E5;&#x9053;&#x7684;&#x8BFB;&#x5199;InfluxDB&#x7684;&#x65B9;&#x6CD5;&#xFF0C;&#x60F3;&#x8981;&#x5B66;&#x4E60;&#x66F4;&#x591A;&#x7684;&#x5199;&#x7684;&#x77E5;&#x8BC6;&#x8BF7;&#x79FB;&#x6B65;<a href="">&#x5199;&#x6570;&#x636E;</a>&#x7AE0;&#x8282;&#xFF0C;&#x8BFB;&#x7684;&#x77E5;&#x8BC6;&#x8BF7;&#x5230;<a href="">&#x8BFB;&#x6570;&#x636E;</a>&#x7AE0;&#x8282;&#x3002;&#x8981;&#x83B7;&#x53D6;&#x66F4;&#x591A;InfluxDB&#x7684;&#x6982;&#x5FF5;&#x7684;&#x4FE1;&#x606F;&#xFF0C;&#x8BF7;&#x67E5;&#x770B;<a href="">&#x5173;&#x952E;&#x6982;&#x5FF5;</a>&#x7AE0;&#x8282;&#x3002;</p>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="installation.html" class="navigation navigation-prev " aria-label="Previous page: 安装">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="../Guide/" class="navigation navigation-next " aria-label="Next page: 使用指南">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"入门指南","level":"1.2.2","depth":2,"next":{"title":"使用指南","level":"1.3","depth":1,"path":"Guide/index.md","ref":"Guide/index.md","articles":[{"title":"写入数据","level":"1.3.1","depth":2,"path":"Guide/writing_data.md","ref":"Guide/writing_data.md","articles":[]},{"title":"查询数据","level":"1.3.2","depth":2,"path":"Guide/querying_data.md","ref":"Guide/querying_data.md","articles":[]},{"title":"采样和数据保留","level":"1.3.3","depth":2,"path":"Guide/downsampling_and_retention.md","ref":"Guide/downsampling_and_retention.md","articles":[]},{"title":"硬件指南","level":"1.3.4","depth":2,"path":"Guide/hardware_sizing.md","ref":"Guide/hardware_sizing.md","articles":[]},{"title":"HTTPS设置","level":"1.3.5","depth":2,"path":"Guide/https_setup.md","ref":"Guide/https_setup.md","articles":[]}]},"previous":{"title":"安装","level":"1.2.1","depth":2,"path":"Introduction/installation.md","ref":"Introduction/installation.md","articles":[]},"dir":"ltr"},"config":{"plugins":["comment"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"comment":{"highlightCommented":true},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"github":"jasper-zhang/influxdb-document-cn","theme":"default","author":"jasper","pdf":{"pageNumbers":true,"fontSize":16,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"InfluxDB中文文档","language":"en","links":{"sidebar":{"InfluxDB中文文档":"https://legacy.gitbook.com/book/jasper-zhang1/influxdb"},"gitbook":true},"gitbook":"*","description":""},"file":{"path":"Introduction/getting_start.md","mtime":"2019-09-29T09:05:38.000Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2019-09-29T09:10:37.143Z"},"basePath":"..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../gitbook/gitbook.js"></script>
    <script src="../gitbook/theme.js"></script>
    
        
        <script src="../gitbook/gitbook-plugin-comment/plugin.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

